<template>
	<view>
		<navBar :title="title">
		</navBar>
		<view class="body">
			<u-parse :html="detail.vip_service_agreement" v-if="type == 1"></u-parse>
			<u-parse :html="detail.partner_service_agreement" v-else></u-parse>
		</view>
	</view>
</template>

<script>
	import navBar from "@/components/navBar/navBar.vue"
	import {
		serverAgreement
	} from "@/api/my.js"
	export default {
		data() {
			return {
				detail: {},
				type: 1
			}
		},
		onLoad(opt) {
			this.type = opt.type || 1
			this.type = parseInt(this.type)
			this.getData()
		},
		computed: {
			title() {
				let str = ""
				switch (this.type) {
					case 1:
						str = "SVIP会员服务协议"
						break;
					case 2:
						str = "合伙人服务协议"
						break
				}
				return str
			}
		},
		methods: {
			async getData() {
				let {
					data
				} = await serverAgreement()
				this.detail = data
				console.log(this.type);
			}
		},
		components: {
			navBar
		}
	}
</script>

<style scoped lang="scss">
	.body {
		padding: 40rpx;
		box-sizing: border-box;
		min-height: 100vh;
		color: #999999;
	}
</style>
